import { Form, DatePicker } from 'antd';
import React from 'react';

import { FormFieldBase } from '../../../typings/FormFieldBase';

export type DatePickerFormFieldProps = FormFieldBase & {};
export const DatePickerFormField: React.FC<DatePickerFormFieldProps> = (props) => {
  const { name, label, rules, config, light } = props;

  return (
    <Form.Item label={ light ? undefined : label} name={name} rules={rules}>
      <DatePicker style={{ width: '100%' }} {...config} />
    </Form.Item>
  )
}
